package com.yxym.homework04;

public class Teacher extends  Employee{
    private double classPay;
    private int days;

    public Teacher(String name, double basicSalary, double grade, double classPay, int days) {
        super(name, basicSalary, grade);
        this.classPay = classPay;
        this.days = days;
    }

    public double getClassPay() {
        return classPay;
    }

    public void setClassPay(double classPay) {
        this.classPay = classPay;
    }

    public int getDays() {
        return days;
    }

    public void setDays(int days) {
        this.days = days;
    }
    public double classPay(){
        return classPay * days;

    }
    @Override//重写父类方法printSalary
    public void printSalary() {
        System.out.println("教师" + getName() + "\t" +
                "基本工资:"  + getBasicSalary()+ "\t" +
                "课酬:" + classPay() + "\t" + "年工资为："  +
                ((getBasicSalary()) + classPay()
                ));
    }
}
